******************************************************************
**************"Taxing the Wealthy in Haiti"***********************
*******Authors: Ana I. Lopez Garcia & Sarah Berens****************
******************************************************************

******************************************************************
*ANALYSIS - CONJOINT EXPERIMENT
*1. Main Results
*2. Subgroup differences 
****2.1 Tax authority
****2.2 Tax collectors
****2.3 Social recognition
****2.4 Tax beneficiaries
****2.5 Tax earmarks
*3. Gang insurrection - Unexpected Event Survey Design
****3.1 Tax authority 
****3.2 Tax collector 
****3.3 Social recognition
****3.4 Tax beneficiaries
*4. Gang presence in neighbourhood

*******************************************************************
* SET WORKING DIRECTORY
use "haiti_conjoint.dta", clear

*******************************************************************
*1. MAIN RESULTS
	
logit evaluation_ i.admin_ i.collects_ i.recognition_ i.beneficiary_ i.purpose_ i.improvement_  [pweight = weight], cluster(id)
margins, dydx(*) post 

*******************************************************************
*2. SUBGROUP DIFFERENCES - AFFLUENT STATUS

*2. 1 TAX ADMINISTRATION / AUTHORITY
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university  [pweight = weight], cluster(id)
mtable, at(university=(0 1) admin_ = (0 (1) 1)) post
mlincom 4 - 2, stat(est p)
mlincom 3 - 1, stat(est p)
mlincom (3 - 1) -  (4 - 2), stat(est p)

*2.2 TAX COLLECTORS
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university  [pweight = weight], cluster(id)
mtable, at(university=(0 1) collects_ = (0 (1) 4)) post	

*community leaders 
mlincom 2 - 1, stat(est p)
mlincom 7- 6, stat(est p)
mlincom (7 - 6) -  (2 - 1), stat(est p)

*religious organisations
mlincom 3 - 1, stat(est p)
mlincom 8- 6, stat(est p)
mlincom (8 - 6) -  (3 - 1), stat(est p)

*foreign ngos
mlincom 5 - 1, stat(est p)
mlincom 10 - 6, stat(est p)
mlincom (10 - 6) -  (5 - 1), stat(est p)

*local ngos
mlincom 4 - 1, stat(est p)
mlincom 9 - 6, stat(est p)
mlincom (9 - 6) -  (4 - 1), stat(est p)

*2.3 SOCIAL RECOGNITION
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university  [pweight = weight], cluster(id)
mtable, at(university=(0 1) recognition_ = (0 (1) 4)) post	
mlincom 2 - 1, stat(est p)
mlincom 7 - 6, stat(est p)
mlincom (7 - 6) -  (2 - 1), stat(est p)

*2.4 BENEFICIARIES
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university  [pweight = weight], cluster(id)
mtable, at(university=(0 1) beneficiary_ = (0 (1) 4)) post	
mlincom 2 - 1, stat(est p)
mlincom 7 - 6, stat(est p)
mlincom (7 - 6) -  (2 - 1), stat(est p)

mlincom 3 - 1, stat(est p)
mlincom 8 - 6, stat(est p)
mlincom (8 - 6) -  (3 - 1), stat(est p)

mlincom 4 - 1, stat(est p)
mlincom 9 - 6, stat(est p)
mlincom (9 - 6) -  (4 - 1), stat(est p)

mlincom 5 - 4, stat(est p)
mlincom 10 - 9, stat(est p)
mlincom (10 - 9) -  (5 - 4), stat(est p)

*2.5 TAX EARMARKS
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university  [pweight = weight], cluster(id)
mtable, at(university=(0 1) purpose_ = (0 (1) 4)) post

*Security vs Welfare 
mlincom 2 - 1, stat(est p)
mlincom 7 - 6, stat(est p)
mlincom (7 - 6) -  (2 - 1), stat(est p)

*Infrastructure vs welfare 
mlincom 3 - 1, stat(est p)
mlincom 8 - 6, stat(est p)
mlincom (8 - 6) -  (3 - 1), stat(est p)

*Security vs waste collection
mlincom 2 - 4, stat(est p)
mlincom 7 - 9, stat(est p)
mlincom (7 - 9) -  (2 - 4), stat(est p)

*Infrastructure vs waste collection
mlincom 3 - 4, stat(est p)
mlincom 8 - 9, stat(est p)
mlincom (8 - 9) -  (3 - 4), stat(est p)

*Security vs water 
mlincom 2 - 5, stat(est p)
mlincom 7 - 10, stat(est p)
mlincom (7 - 10) -  (2 - 5), stat(est p)

*Infrastructure vs water 
mlincom 3 - 5, stat(est p)
mlincom 8 - 10, stat(est p)
mlincom (8 - 10) -  (3 - 5), stat(est p)


********************************************************************************
**3. USED (UNEXPECTED SURVEY EVENT DESIGN) 

*Checking how results vary before / after gang upheaval

logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president [pweight = weight], cluster(id)

********************************************************************************	
*3.1 Trust in authorities - Municipal vs National  
qui logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president [pweight = weight], cluster(id)

mtable, at(university=(0 (1) 1) admin_ = (0 (1) 1) president = (0 (1) 1)) post	

*Trust in authorities - Municipal vs National - before gang upheaval*
*nonaffluent - before 
mlincom 5 - 1, stat(est p)
*affluent - before
mlincom 7 - 3, stat(est p)
*affluent vs nonaffluent - before
mlincom (5 - 1) -  (7 - 3), stat(est p)

*Trust in authorities - Municipal vs National  - after gang upheaval*
*nonaffluent - after
mlincom 6 - 2, stat(est p)
*affluent - after
mlincom 8 - 4, stat(est p)
*affluent vs nonaffluent - after
mlincom (6 - 2) -  (8 - 4), stat(est p)


*Trust in authorities - Municipal vs National for the affluent before vs after 
mlincom (7 - 3)  -  (8 - 4), stat(est p)

*Difference in the treatment (event) effect for nonaffluent compared to the affluent 
mlincom ((5 - 1) - (6 - 2)) - ((7 - 3) - (8 - 4)), stat(est p)


********************************************************************************
*3.2 Tax Collector (second differences)
qui logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president [pweight = weight], cluster(id)

mtable, at(university=(0 (1) 1) collects_ = (0 (1) 4) president = (0 (1) 1)) post	

*Tax Collector (second differences) before gang upheaval
*nonaffluent before
mlincom 5 - 1, stat(est p)
*affluent before
mlincom 15 - 11, stat(est p)
*affluent vs nonaffluent - before
mlincom (5 - 1) -  (15 - 11), stat(est p)

*Tax Collector (second differences) - after gang upheaval
*non affluent - after  
mlincom 10 - 6, stat(est p)
*affluent - after
mlincom 20 - 16, stat(est p)
*affluent vs nonaffluent - after
mlincom (10 - 6) -  (20 - 16), stat(est p)

*Tax Collector (second differences) difference in the treatment (event) effect for nonaffluent compared to the affluent 
mlincom ((5 - 1) - (10 - 6)) - ((15 - 11) - (20 - 16)), stat(est p)

*Tax Collector (second differences) affluent before vs after 
mlincom (15 - 11)  -  (20 - 16), stat(est p)

********************************************************************************
*3.3 Social recognition 
qui logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president [pweight = weight], cluster(id)

mtable, at(university=(0 (1) 1) recognition_ = (0 (1) 4) president = (0 (1) 1)) post	

*Social recognition (second differences) before gang upheaval
*nonaffluent before
mlincom 2 - 1, stat(est p)
*affluent before
mlincom 12 - 11, stat(est p)
*affluent vs nonaffluent - before
mlincom (2 - 1) -  (12 - 11), stat(est p)


*Social recognition (second differences) after gang upheaval*
*non affluent - after  
mlincom 7 - 6, stat(est p)
*affluent - after
mlincom 17 - 16, stat(est p)
*affluent vs nonaffluent - after
mlincom (7 - 6) -  (17 - 16), stat(est p)

*Social recognition (second differences) difference in the treatment (event) effect for nonaffluent compared to the affluent 
mlincom ((2 - 1) -  (7 - 6)) - ((12 - 11) -  (17 - 16)), stat(est p)

********************************************************************************
*3.4 Tax Beneficiaries
qui logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president [pweight = weight], cluster(id)

mtable, at(university=(0 (1) 1) beneficiary_ = (0 (1) 4) president = (0 (1) 1)) post	

*Tax Beneficiaries (second differences) before gang upheaval
*nonaffluent before
mlincom 5 - 4, stat(est p)
*affluent before
mlincom 15 - 14, stat(est p)
*affluent vs nonaffluent - before
mlincom (5 - 4) -  (15 - 14), stat(est p)

*Tax Beneficiaries (second differences) after gang upheaval
*non affluent - after  
mlincom 10 - 9, stat(est p)
*affluent - after
mlincom 20 - 19, stat(est p)
*affluent vs nonaffluent - after
mlincom (10 - 9) -  (20 - 19), stat(est p)

*Tax Beneficiaries (second differences) difference in the treatment (event) effect for nonaffluent compared to the affluent 
mlincom ((5 - 4) -  (10 - 9)) - ((15 - 14) -  (20 - 19)), stat(est p)

*************************************************************************
*Tax Beneficiaries (second differences) before gang upheaval*
*nonaffluent before
mlincom 2 - 1, stat(est p)
*affluent before
mlincom 12 - 11, stat(est p)
*affluent vs nonaffluent - before
mlincom (12 - 11) -  (2 - 1), stat(est p)

*Tax Beneficiaries (second differences) after gang upheaval*
*non affluent - after  
mlincom 7 - 6, stat(est p)
*affluent - after
mlincom 17 - 16, stat(est p)
*affluent vs nonaffluent - after
mlincom (17 - 16) -  (7 - 6), stat(est p)

*difference in the treatment (event) effect for nonaffluent compared to the affluent 
mlincom ((2 - 1) -  (7 - 6)) - ((12 - 11) -  (17 - 16)), stat(est p)


**************************************************************************************
*4. GANG PRESENCE IN NEIGHBOURHOOD
**************************************************************************************
logit evaluation_ i.admin_##i.university##i.gang i.collects_##i.university##i.gang  i.recognition_##i.university##i.gang  i.beneficiary_##i.university##i.gang  i.purpose_##i.university##i.gang ///
	i.improvement_##i.university##i.gang [pweight = weight], cluster(id)

mtable, at(university=(0 (1) 1) collects_ = (0 (1) 4) gang = (0 (1) 1)) post	

*No gang presence - second differences
*nonaffluent 
mlincom 5 - 1, stat(est p)
*affluent before
mlincom 15 - 11, stat(est p)
*affluent vs nonaffluent - before
mlincom (5 - 1) -  (15 - 11), stat(est p)

*Gang presence - second differences
*non affluent - after  
mlincom 10 - 6, stat(est p)
*affluent - after
mlincom 20 - 16, stat(est p)
*affluent vs nonaffluent - after
mlincom (10 - 6) -  (20 - 16), stat(est p)

*Difference in gang presence effect for nonaffluent compared to the affluent 
mlincom ((5 - 1) - (10 - 6)) - ((15 - 11) - (20 - 16)), stat(est p)
*affluent before vs after 
mlincom (15 - 11)  -  (20 - 16), stat(est p)
